<!--
 每个页面的搜索
 -->
<template>
  <el-form ref="searchRef" inline="inline" :model="formInline" class="el-form" >
        <template v-for="(item) in rows">
          <el-form-item>
              <el-input v-model="formInline[item.type]" :placeholder="item.placeholder" clearable>
              </el-input>
          </el-form-item>
        </template>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="search">搜索</el-button>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-refresh-right" @click="reset">重置</el-button>
      </el-form-item>
  </el-form>
</template>

<script>
export default {
  name: "search",
  props: {
    formInline: {type: Object},
    rows: {type: Object}},
  emits: ['search','reset'],
  data() {
    return {
      inline: true,
      formInlines: this.formInline
    }
  },
  created() {

  },
  methods: {
    search() {
      this.$emit('search')
    },
    reset() {
      //this.$refs.searchRef.resetFields()
      this.$emit('reset')
    }
  }
}
</script>

<style scoped>
.el-form{
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  margin-top: 15px;
}
.el-form .el-form-item .el-input{
  margin-left:10px;
}
.el-form .el-button {
  float: right;
  margin: 0 0 0 15px;
}
</style>